pluginHome = new File("./plugins").listFiles().find { it.name.startsWith('cloud-tools-')}
if(pluginHome == null) pluginHome = "."

includeTargets << new File( "${pluginHome}/scripts/CloudToolsInit.groovy" )

target('default': "Verifies your AWS Credentials") {
	verify()
}

target(verify: "The implementation task") {
    depends( initCloudToolsService)

    event("StatusUpdate", ["Starting verification"])

    def awsProperties = cloudToolsService.makeAWSProperties()
    def verifier = new net.chrisrichardson.ec2deployer.core.AwsCredentialsVerifier(awsProperties)
    verifier.verify()

    event("StatusFinal", ["Verification complete"])

}


